<%--
  Created by IntelliJ IDEA.
  User: ZT171
  Date: 2024/9/27
  Time: 20:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css" >
    <style>
    </style>
</head>
<body>
    <p>
        <form action="/student/list/1" method="post">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <div class="layui-input-inline layui-input-wrap">
                        <input type="text" placeholder="请输入学号" name="studentNum" value="${student.studentNum}" class="layui-input">
                    </div>
                    <div class="layui-input-inline layui-input-wrap">
                        <input type="text" placeholder="请输入学生的名" name="studentName" value="${student.studentName}" class="layui-input">
                    </div>
                    <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
                    <a class="layui-btn layui-bg-blue" href="/student/toAdd">新增学生</a>
                </div>
            </div>
        </form>
    </p>


    <table class="layui-table" lay-even>
        <colgroup>
            <col width="150">
            <col width="150">
            <col>
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>编号</th>
            <th>学号</th>
            <th>学生的名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>出生日期</th>
            <th>班级编号</th>
            <th>宿舍编号</th>
            <th>联系电话</th>
            <th>电子邮件地址</th>
            <th>家庭住址</th>
            <th>紧急联系人姓名</th>
            <th>紧急联系人联系电话</th>
            <th>专业</th>
            <th>学生状态</th>
            <th>删除标志</th>
            <th>创建者</th>
            <th>创建时间</th>
            <th>更新者</th>
            <th>更新时间</th>
            <th>备注</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${students}" var="s">
            <tr>
                <td>${s.sId}</td>
                <td>${s.studentNum}</td>
                <td>${s.studentName}</td>
                <td>
                    <c:choose>
                        <c:when test="${s.gender == '0'}">
                           男
                        </c:when>
                        <c:when test="${s.gender == '1'}">
                            女
                        </c:when>
                        <c:otherwise>
                            保密
                        </c:otherwise>
                    </c:choose>
                </td>
                <td>${s.age}</td>
                <td><fmt:formatDate value="${s.birthday}" pattern="yyyy年MM月dd日"></fmt:formatDate></td>
                <td>${s.classId}</td>
                <td>${s.hostelId}</td>
                <td>${s.phone}</td>
                <td>${s.email}</td>
                <td>${s.homeAddress}</td>
                <td>${s.emergencyContact}</td>
                <td>${s.emergencyPhone}</td>
                <td>${s.major}</td>
                <td>
                    <c:choose>
                        <c:when test="${s.status == '1'}">
                            毕业
                        </c:when>
                        <c:otherwise>
                            在读
                        </c:otherwise>
                    </c:choose>
                </td>
                <td>
                    <c:choose>
                        <c:when test="${s.status == '1'}">
                            删除
                        </c:when>
                        <c:otherwise>
                            存在
                        </c:otherwise>
                    </c:choose>
                </td>
                <td>${s.creatby}</td>
                <td><fmt:formatDate value="${s.createTime}" pattern="yyyy年MM月dd日 HH时mm分ss秒"></fmt:formatDate></td>
                <td>${s.updateby}</td>
                <td><fmt:formatDate value="${s.updateTime}"  pattern="yyyy年MM月dd日 HH时mm分ss秒"></fmt:formatDate></td>
                <td>${s.remark}</td>
                <td>
                    <a href="/student/toupdate/${s.sId}">编辑</a>
                    <a href="/student/delete/${s.sId}">删除</a>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="4">
                <a href="/student/list/1">首页</a>
                <c:if test="${page.currentPage != 1}">
                    <a href="/student/list/${page.currentPage-1}">上一页</a>
                </c:if>
                &nbsp;第${page.currentPage}页/总${page.totalPage}页&nbsp;
                <c:if test="${page.currentPage != page.totalPage}">
                    <a href="/student/list/${page.currentPage+1}">下一页</a>
                </c:if>
                <a href="/student/list/${page.totalPage}">末页</a>
            </td>
        </tr>
        </tbody>
    </table>
</body>
</html>
